/******************************************************************************
 * @File name   :      IMaintainCarPlateDao.java
 *
 * @Author      :      ANMA
 *
 * @Date        :      Jul 21, 2015
 *
 * @Copyright Notice: 
 * Copyright (c) 2014 DMS, Inc. All  Rights Reserved.
 * This software is published under the terms of the DMS Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * ----------------------------------------------------------------------------
 * Date                         Who         Version         Comments
 * Jul 21, 2015 5:18:41 PM    ANMA      1.0            Initial Version
 *****************************************************************************/
package com.cap.bts.crmdp.dealer.logistic.dao;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.cap.bts.crmdp.dealer.logistic.domain.LogisticProcess;
import com.cap.bts.crmdp.dealer.logistic.dto.LogisticDataDto;
import com.cap.bts.crmdp.dealer.logistic.dto.LogisticImportResultDto;
import com.cap.bts.crmdp.dealer.logistic.dto.LogisticPrintDataDto;
import com.cap.bts.crmdp.dealer.logistic.dto.LogisticQueryDto;
import com.cap.bts.crmdp.dealer.logistic.dto.LogisticRelatedDto;
import com.cap.bts.crmdp.dealer.report.dto.InventoryDataDto;
import com.cap.bts.crmdp.dealer.report.dto.MemberChartDto;
import com.cap.bts.crmdp.dealer.report.dto.MemberReportDetailsDto;
import com.cap.bts.crmdp.dealer.report.dto.MemberReportDto;
import com.cap.bts.crmdp.dealer.report.dto.ReportQueryDto;
import com.cap.bts.crmdp.dealer.report.dto.SalesReportDetailsDto;
import com.cap.bts.crmdp.dealer.report.dto.SalesReportDto;
import com.cap.bts.framework.common.dao.IBaseDao;
import com.cap.bts.framework.common.exception.AppException;

/**
 * 
 */
public interface IMaintainLogisticDao extends IBaseDao<LogisticProcess, Long> {

	
	/**
	 * 根据dto获取List<CarPlateInfo>
	 * @Date        :      2015-7-20
	 * @param dto
	 * @return
	 * @throws AppException
	 */
    public String preRequest(LogisticQueryDto queryDto);
    public List<LogisticDataDto> queryLogisticData(LogisticQueryDto queryDto);
    public List<LogisticQueryDto> logisticDataForPrintGroup(LogisticQueryDto queryDto);
    public List<LogisticPrintDataDto> queryLogisticDataForPrint(LogisticQueryDto queryDto,List<LogisticQueryDto> dto);
    public List<String> getDealerName(String dealerNo);
    public Map<String,String> getDealers();
    public List<LogisticRelatedDto> getCardName();
    public List<LogisticRelatedDto> getSMSName();
    public List<LogisticRelatedDto> getPackageName();
    public List<String> existCardName();
    public String getDealerId(String dealerNo);
    public String getCardId(String cardName);
    public void insertLogisticInfo(LogisticDataDto newDto,String dealerId,String cardDefId);
    public LogisticDataDto queryLogisticDataById(String id);
    public Integer updateLogisticInfo(final String id,final int shipAmount,final Date shipDate
                    ,final Date estimatedArriveDate,final String expressCom
                    ,final String expressNo,final String editor);
    public String getAmountById(String id);
    public Integer deleteLogisticInfo(final String id);
    public List<LogisticDataDto> queryReceiveLogisticData(LogisticQueryDto queryDto);
    public Integer receiveLogistic(final String id,final int receiveAmount,final String editor);
    public String queryCardInventoryInfo(String dealerId,String cardDefId);
    public Integer updateCardInventory(final String id,final int amount,final String editor);
    public void insertCardInventory(final String dealerId, final String cardDefId, final int amount, final String editor);
    public void deleteAll();
    public void saveLogisticToTemp(List<LogisticDataDto> dataList) throws AppException;
    public List<LogisticImportResultDto> getWrongDealerNo();
    public List<LogisticImportResultDto> getWrongCardName();
    public List<LogisticImportResultDto> getWrongEstimate();
    /**
     * @Date        :      Sep 1, 2015
     * @param dealerId
     * @return
     */
    public String getTransactionEndDay(String endMonth);    
	public List<InventoryDataDto> getMonthAmt(ReportQueryDto dto,List<InventoryDataDto> dataList);
    public List<String> getDealerList(String dealerId);
	public String getDealers(String dealerId);
    public List<InventoryDataDto> queryInventoryDataOrdered(ReportQueryDto dto,List<LogisticRelatedDto> dataList);
    public List<InventoryDataDto> queryInventoryDataSelled(ReportQueryDto dto,List<InventoryDataDto> dataList);
    public List<InventoryDataDto> queryInventoryAllSelled(ReportQueryDto dto,List<InventoryDataDto> dataList);
    public List<InventoryDataDto> queryInventoryDataInventory(ReportQueryDto dto,List<InventoryDataDto> dataList);
    public List<InventoryDataDto> queryInventoryDataOnRoad(ReportQueryDto dto,List<InventoryDataDto> dataList);

    public List<String> getAllMonth(ReportQueryDto dto);
    public List<LogisticRelatedDto> getSelledCard(ReportQueryDto dto);
    public String queryInventoryDataSelledForChart
                (ReportQueryDto dto,List<LogisticRelatedDto> dataList,List<String> months) throws AppException;

    public MemberReportDto getNewMember(ReportQueryDto dto);
    public MemberReportDto getNewPackage(MemberReportDto data);
    public MemberReportDto getNewCar(MemberReportDto data);
    public MemberReportDto getHistoryQty(MemberReportDto data);
    public MemberReportDto getHistoryPackageQty(MemberReportDto data);
    
    public List<MemberReportDetailsDto> getNewMemberDetails(ReportQueryDto dto);
    public List<MemberReportDetailsDto> getNewPackageDetails(ReportQueryDto dto);
    public List<MemberReportDetailsDto> getNewCarDetails(ReportQueryDto dto);
    
    public MemberChartDto queryMemberDataForChart(ReportQueryDto dto,String month);
    public MemberChartDto queryPackageDataForChart(MemberChartDto dto,String userId,String packageId);
    public MemberChartDto queryCarDataForChart(MemberChartDto dto,String userId);
    public MemberChartDto queryAccumulateMemberDataForChart(MemberChartDto dto,String userId);
    
    public SalesReportDto getSalesVolume(ReportQueryDto dto,String dealerNo);
    public SalesReportDto getSalesReport(ReportQueryDto dto,String dealerNo);
    public List<SalesReportDetailsDto> exportSalesReport(ReportQueryDto salesDto);
    public SalesReportDto getPeriodPrePay(ReportQueryDto dto);
    public SalesReportDto getPeriodUsed(SalesReportDto data);
    public SalesReportDto getPeriodExpired(SalesReportDto data);
    public SalesReportDto getPeriodIncome(SalesReportDto data);
    public SalesReportDto getAccumulatePrePay(SalesReportDto data);
    public SalesReportDto getAccumulateUsed(SalesReportDto data);
    public SalesReportDto getAccumulateExpired(SalesReportDto data);
    public SalesReportDto getAccumulateIncome(SalesReportDto data);
    public SalesReportDto getAccumulateNotUsed(SalesReportDto data);
    public List<SalesReportDetailsDto> getPeriodPrePayDetails(ReportQueryDto dto);
    public List<SalesReportDetailsDto> getPeriodUsedDetails(ReportQueryDto dto);
    public List<SalesReportDetailsDto> getPeriodExpiredDetails(ReportQueryDto dto);
    public List<SalesReportDetailsDto> getAccumulateNotUsedDetails(ReportQueryDto dto);
    
    public List<LogisticProcess> getLogisticProcessListByDealerIdAndLogisticType(Long dealerId,Integer logisticType) throws AppException;
    public List<Object[]> getLogisticProcessHistoryListByDealerIdAndLogisticType(Long dealerId,Integer logisticType) throws AppException;
	List<LogisticDataDto> queryAllLogisticData(LogisticQueryDto queryDto);
}
